using System.ComponentModel.DataAnnotations;
 using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;
namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class JobVacancyMap : EntityTypeConfiguration<JobVacancy>
    {
        public JobVacancyMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.schoolname)
                .HasMaxLength(50);

            this.Property(t => t.jobname)
                .HasMaxLength(50);

            this.Property(t => t.jobdesc)
                .HasMaxLength(400);

            this.Property(t => t.jobskill)
                .HasMaxLength(400);

            this.Property(t => t.jobemail)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("JobVacancy");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.schoolname).HasColumnName("schoolname");
            this.Property(t => t.dateonline).HasColumnName("dateonline");
            this.Property(t => t.jobname).HasColumnName("jobname");
            this.Property(t => t.jobdesc).HasColumnName("jobdesc");
            this.Property(t => t.jobskill).HasColumnName("jobskill");
            this.Property(t => t.jobemail).HasColumnName("jobemail");
        }
    }
}
